package com.ugoodtech.mdcc.web.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ugoodtech.mdcc.core.Constants;
import com.ugoodtech.mdcc.core.domain.CustomerRegularReport;
import org.apache.commons.lang3.StringUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class CustomerStatResponse {

    @JsonIgnore
    private SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT);

    private SimpleDateFormat simple = new SimpleDateFormat(Constants.DATE_FORMAT);

    private Date date;

    private Long reportId;

    private Long stationId;

    private String userName = "";

    private String stationName = "";

    private String serviceStartTime = "";

    private String serviceEndTime = "";

    private String serviceType = "";

    private String serviceStat = "";

    private String servicePoint = "";

    private String customerName = "";

    private String customerPosition = "";

    private String customerTelephone = "";

    private String msgSended = "";

    private String createCustomerReportTime = "";

    private String score = "";

    private String provice = "";

    private String stationNum = "";

    private String stationStatus = "";

    private String stationType = "";

    private String brand = "";

    private String paintService = "";

    private String questionScore_1 = "";

    private String questionScore_2 = "";

    private String questionScore_3 = "";

    private String questionScore_4 = "";

    private String questionScore_5 = "";

    private String questionScore_6 = "";

    private String questionScore_7 = "";

    private String manageName = "";

    private String manageTime = "";

    private String manageNote = "";

    public CustomerStatResponse(CustomerRegularReport customerRegularReport, String userName, String customerName) {
        this.reportId = customerRegularReport.getCustomerReport().getId();
        this.stationId = customerRegularReport.getRegularReport().getStation().getId();
        this.userName = userName;
        this.customerName = customerName;
        this.stationName = customerRegularReport.getRegularReport().getStation().getName();
        date = customerRegularReport.getRegularReport().getStartServiceTime();
        this.serviceStartTime = simple.format(date);
        date = customerRegularReport.getRegularReport().getEndServiceTime();
        this.serviceEndTime = simple.format(date);
        this.msgSended = simpleDateFormat.format(customerRegularReport.getCreationTime());
        date = customerRegularReport.getCustomerReport().getCreationTime();
        this.createCustomerReportTime = simpleDateFormat.format(date);
        this.score = customerRegularReport.getScore();
        if (StringUtils.isNotEmpty(customerRegularReport.getManageNote())) {
            this.manageNote = customerRegularReport.getManageNote();
            this.manageTime = customerRegularReport.getUpdateTimeStr();
        }

    }

    public CustomerStatResponse(CustomerRegularReport customerRegularReport, String userName, String customerName, Date smsSendDate) {
        this.reportId = customerRegularReport.getCustomerReport().getId();
        this.stationId = customerRegularReport.getRegularReport().getStation().getId();
        this.userName = userName;
        this.customerName = customerName;
        this.stationName = customerRegularReport.getRegularReport().getStation().getName();
        date = customerRegularReport.getRegularReport().getStartServiceTime();
        this.serviceStartTime = simple.format(date);
        date = customerRegularReport.getRegularReport().getEndServiceTime();
        this.serviceEndTime = simple.format(date);
        this.msgSended = smsSendDate != null ? simpleDateFormat.format(smsSendDate) : "";
        date = customerRegularReport.getCustomerReport().getCreationTime();
        this.createCustomerReportTime = simpleDateFormat.format(date);
        this.score = customerRegularReport.getScore();
        if (StringUtils.isNotEmpty(customerRegularReport.getManageNote())) {
            this.manageNote = customerRegularReport.getManageNote();
            this.manageTime = customerRegularReport.getUpdateTimeStr();
        }

    }


    public Long getReportId() {
        return reportId;
    }

    public void setReportId(Long reportId) {
        this.reportId = reportId;
    }

    public Long getStationId() {
        return stationId;
    }

    public void setStationId(Long stationId) {
        this.stationId = stationId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getServiceStartTime() {
        return serviceStartTime;
    }

    public void setServiceStartTime(String serviceStartTime) {
        this.serviceStartTime = serviceStartTime;
    }

    public String getServiceEndTime() {
        return serviceEndTime;
    }

    public void setServiceEndTime(String serviceEndTime) {
        this.serviceEndTime = serviceEndTime;
    }

    public String getServiceType() {
        return serviceType;
    }

    public void setServiceType(String serviceType) {
        this.serviceType = serviceType;
    }

    public String getServiceStat() {
        return serviceStat;
    }

    public void setServiceStat(String serviceStat) {
        this.serviceStat = serviceStat;
    }

    public String getServicePoint() {
        return servicePoint;
    }

    public void setServicePoint(String servicePoint) {
        this.servicePoint = servicePoint;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCustomerPosition() {
        return customerPosition;
    }

    public void setCustomerPosition(String customerPosition) {
        this.customerPosition = customerPosition;
    }

    public String getCustomerTelephone() {
        return customerTelephone;
    }

    public void setCustomerTelephone(String customerTelephone) {
        this.customerTelephone = customerTelephone;
    }

    public String getMsgSended() {
        return msgSended;
    }

    public void setMsgSended(String msgSended) {
        this.msgSended = msgSended;
    }

    public String getCreateCustomerReportTime() {
        return createCustomerReportTime;
    }

    public void setCreateCustomerReportTime(String createCustomerReportTime) {
        this.createCustomerReportTime = createCustomerReportTime;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public String getQuestionScore_1() {
        return questionScore_1;
    }

    public void setQuestionScore_1(String questionScore_1) {
        this.questionScore_1 = questionScore_1;
    }

    public String getQuestionScore_2() {
        return questionScore_2;
    }

    public void setQuestionScore_2(String questionScore_2) {
        this.questionScore_2 = questionScore_2;
    }

    public String getQuestionScore_3() {
        return questionScore_3;
    }

    public void setQuestionScore_3(String questionScore_3) {
        this.questionScore_3 = questionScore_3;
    }

    public String getQuestionScore_4() {
        return questionScore_4;
    }

    public void setQuestionScore_4(String questionScore_4) {
        this.questionScore_4 = questionScore_4;
    }

    public String getQuestionScore_5() {
        return questionScore_5;
    }

    public void setQuestionScore_5(String questionScore_5) {
        this.questionScore_5 = questionScore_5;
    }

    public String getQuestionScore_6() {
        return questionScore_6;
    }

    public void setQuestionScore_6(String questionScore_6) {
        this.questionScore_6 = questionScore_6;
    }

    public String getQuestionScore_7() {
        return questionScore_7;
    }

    public void setQuestionScore_7(String questionScore_7) {
        this.questionScore_7 = questionScore_7;
    }

    public String getManageNote() {
        return manageNote;
    }

    public void setManageNote(String manageNote) {
        this.manageNote = manageNote;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getManageName() {
        return manageName;
    }

    public void setManageName(String manageName) {
        this.manageName = manageName;
    }

    public String getManageTime() {
        return manageTime;
    }

    public void setManageTime(String manageTime) {
        this.manageTime = manageTime;
    }

    public String getProvice() {
        return provice;
    }

    public void setProvice(String provice) {
        this.provice = provice;
    }

    public String getStationNum() {
        return stationNum;
    }

    public void setStationNum(String stationNum) {
        this.stationNum = stationNum;
    }

    public String getStationStatus() {
        return stationStatus;
    }

    public void setStationStatus(String stationStatus) {
        this.stationStatus = stationStatus;
    }

    public String getStationType() {
        return stationType;
    }

    public void setStationType(String stationType) {
        this.stationType = stationType;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getPaintService() {
        return paintService;
    }

    public void setPaintService(String paintService) {
        this.paintService = paintService;
    }
}
